package com.celeritymq.destination;

import javax.jms.JMSException;
import javax.jms.TemporaryTopic;

import com.celeritymq.session.CelerityTopicSession;

public class CelerityTemporaryTopic extends CelerityTopic implements TemporaryTopic {
	private boolean delete = false;
	private CelerityTopicSession session;

	public CelerityTemporaryTopic(CelerityTopicSession session, String topicName) {
		super(topicName);
		this.session = session;
	}

	@Override
	public void delete() throws JMSException {
		session.unsubscribeTemporaryTopic(topicName);
		delete = true;
	}

	public boolean isDeleted() {
		return delete;
	}

}
